package com.demo.function.spring.feign;

import com.demo.function.spring.feign.fallback.MiyaFeignClientFallbackFactory;
import com.demo.model.entity.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "service-miya", contextId = "miyaFeignClientV2", fallbackFactory = MiyaFeignClientFallbackFactory.class)
public interface MiyaFeignClientV2 {

    @PostMapping("/modifyUserException")
    User modifyUserException(@RequestBody User user);

    @GetMapping("/processLongTime")
    User processLongTime(@RequestParam("timeout") long timeout);
}
